package evo.springboot.controller;


import evo.springboot.config.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {
    /*
    @Value("${school-name}")  //#自定义配置映射到变量
    private String schoolName;
    @Value("${websit}")
    private String websit;
    */
    @Autowired
    private School school;

    @RequestMapping(value = "/say")
    @ResponseBody
    public String say(){
        //return "hello "+schoolName+" 网址 "+websit;
        return "";
    }

    @RequestMapping(value = "/say2")
    @ResponseBody
    public String say2(){
        return "hello "+school.getName()+" 网址 "+school.getWebsit();
    }
}
